<template>
	<view>
		<view aria-role="tab" class="box_icon">
			<view class="top_icon" :style="{background:msgitem.icolor}"><text :class="msgitem.icons"></text></view>
			<text>{{ msgitem.name }}</text>
			<br />
			<text class="result">发布时间：{{ msgitem.ptime }}</text>
		</view>
		<view class="bg-white padding-lr-sm padding-bottom-sm padding-top-xs margin-left-sm margin-right-sm" style="border-radius: 16rpx;">
			<view class="flex" style="margin-top: 30rpx;">
				<view style="width: 23%;">发布标题：</view>
				<view style="width: 77%;">{{ msgitem.title }}</view>
			</view>
			<view class="flex" style="margin-top: 30rpx;">
				<view style="width: 23%;">文章内容：</view>
				<view style="width: 77%;">{{ msgitem.texts }}</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			item:{},
			msgitem:{},
		};
	},
	onLoad(msgData) {
		this.item = JSON.parse(msgData.item);
		this.msg(this.item.id);
		this.read(this.item.id);
		this.app(this.item.aid);
		
	},
	methods: {
		msg(id){
			uni.showLoading({title:'加载中'})
			this.$request.getForm('/view/msgs/aview',{id:id}).then(
			res => {
				uni.hideLoading()
				this.msgitem = res.data
			},
			err => {
				console.log("失败")
			}
			)
		},
		read(id) {
			this.$request.getForm('/view/msgs/aread', { id: id }).then(
				res => {
				}, 
				err => {
				}
			);
		},
		app(aid){
			this.$request.getForm('/view/apps/view',{id:aid}).then(
				res => {
				},
				err => {
					console.log("失败")
				}
			)
		}
	}
};
</script>

<style>
.box_icon {
	margin: 24rpx;
	text-align: center;
	font-size: 30rpx;
	padding: 80rpx 0 100rpx 0;
	background-color: #ffffff;
	border-radius: 18rpx;
}
.box_icon > .box_img {
	position: absolute;
	right: 24rpx;
	top: 24rpx;
	width: 214rpx;
	height: 204rpx;
}
.box_icon > text:nth-of-type(1) {
	font-size: 34rpx;
	font-weight: 500;
}
.top_icon {
	width: 112rpx;
	height: 112rpx;
	display: block;
	border-radius: 24rpx;
	margin: auto;
	margin-bottom: 20rpx;
}
.top_icon > icon {
	color: #fff;
	font-size: 96rpx;
	line-height: 112rpx;
}
.result {
	color: #999;
	font-size: 28rpx;
	padding-top: 24rpx;
	display: block;
}
</style>
